/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package AccesoDatos.Persistencia.Entidad;

import java.io.Serializable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author sebaxtian
 */
@Entity
@Table(name = "DESCRIBIR")
@NamedQueries({
    @NamedQuery(name = "EDescribir.findAll", query = "SELECT e FROM EDescribir e"),
    @NamedQuery(name = "EDescribir.findByIdpalabra", query = "SELECT e FROM EDescribir e WHERE e.eDescribirPK.idpalabra = :idpalabra"),
    @NamedQuery(name = "EDescribir.findByIsbn", query = "SELECT e FROM EDescribir e WHERE e.eDescribirPK.isbn = :isbn")})
public class EDescribir implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected EDescribirPK eDescribirPK;

    public EDescribir() {
    }

    public EDescribir(EDescribirPK eDescribirPK) {
        this.eDescribirPK = eDescribirPK;
    }

    public EDescribir(int idpalabra, long isbn) {
        this.eDescribirPK = new EDescribirPK(idpalabra, isbn);
    }

    public EDescribirPK getEDescribirPK() {
        return eDescribirPK;
    }

    public void setEDescribirPK(EDescribirPK eDescribirPK) {
        this.eDescribirPK = eDescribirPK;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (eDescribirPK != null ? eDescribirPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EDescribir)) {
            return false;
        }
        EDescribir other = (EDescribir) object;
        if ((this.eDescribirPK == null && other.eDescribirPK != null) || (this.eDescribirPK != null && !this.eDescribirPK.equals(other.eDescribirPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "AccesoDatos.Persistencia.Entidad.EDescribir[eDescribirPK=" + eDescribirPK + "]";
    }

}
